<template>
  <div>
    <h2>学生姓名：{{ name }}</h2>
    <h2>学生年龄：{{ age }}</h2>
    <button @click="sendName">发送Name到App组件</button>
  </div>
</template>

<script>
export default {
    name:'student',
    data() {
        return {
            name:'张三',
            age:18
        }
    },
    methods: {
        sendName(){
            console.info('发送到App')
            this.$emit('myEvent',this.name,1,2,3,{a:1,b:2})
        }
    },
}
</script>

<style scoped>
div{
    background-color: orange;
}
</style>